package cn.itcast.bos.mq;

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.util.HashMap;
import java.util.Map;

import javax.jms.BytesMessage;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.servlet.ServletContext;
import javax.ws.rs.core.MediaType;

import org.apache.cxf.jaxrs.client.WebClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.web.context.ContextLoaderListener;
import cn.itcast.bos.constant.Constants;
import cn.itcast.bos.domain.take_delivery.Promotion;
import cn.itcast.bos.web.action.PromotionAction;
import freemarker.template.Configuration;
import freemarker.template.Template;

@Service("promotionConsumer")
public class PromotionConsumer implements MessageListener {

	private final Logger Log = LoggerFactory.getLogger(PromotionConsumer.class);
	
	@Override
	public void onMessage(Message message) {
		BytesMessage bytesMessage = (BytesMessage) message;
		if (bytesMessage != null) {
			PromotionAction.CREATE_HTML = true;
			Log.info("PromotionConsumer CREATE_HTML="+PromotionAction.CREATE_HTML);
		}

	}
}
